package com.witdata.controller.docker;

import com.witdata.common.domain.Result;
import com.witdata.common.service.sql.SqlService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/docker/sql")
public class SqlController {
    private final SqlService sqlService;

    @PostMapping("/create")
    public Result<String> createSqlContainer(@RequestParam("instanceId") Long instanceId) {
        sqlService.createSqlContainer(instanceId);
        return Result.ok();
    }

}
